import Vue from 'vue'
import Router from 'vue-router'
import home from "../views/Home"
import fatie from "../views/fatie"
import homePage from "../views/homePage"
import search from "../views/search"
import show from "../views/show"
import userindex from "../views/userindex"
import edit from "../views/edit"
import mysc from "../views/mysc"
import myinvite from "../views/myinvite"
Vue.use(Router)

// app.vue是默认启动窗口，home.vue会插进app.vue
const routes = [
  {
    path: "/",
    component: home,
    name: "主页",
    children: [
      {
        path: '/homePage',
        name: 'homePage',
        component: homePage,
        meta: {
          keepAlive: false,
          title: '首页'
        }
      },
      {
        path: '/search',
        name: 'search',
        component: search,
        meta: {
          keepAlive: false,
          title: '搜索页面'
        }
      },
      {
        path: '/show',
        name: 'show',
        component: show,
        meta: {
          keepAlive: false,
          title: '帖子正文'
        }
      },
      {
        path: "/fatie",
        component: fatie,
        name: "发布",
      }, {
        path: '/userindex',
        name: 'userindex',
        component: userindex,
        meta: {
          keepAlive: false,
          title: '用户主页'
        }
      },
      {
        path: '/mysc',
        name: 'mysc',
        component: mysc,
        meta: {
          keepAlive: false,
          title: '收藏'
        }
      },
      {
        path: '/myinvite',
        name: 'myinvite',
        component: myinvite,
        meta: {
          keepAlive: false,
          title: '我的帖子'
        }
      },
      
      {
        path: '/edit',
        name: 'edit',
        component: edit,
        meta: {
          keepAlive: false,
          title: '用户设置'
        }
      },
    ]
  },

  
]
const router = new Router({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});

export default router;